package com.econ.powercloud.ems.domain;

import com.econ.powercloud.common.base.facade.util.JacksonUtil;
import com.econ.powercloud.ems.dal.entity.EmsEnergySchedule;
import com.econ.powercloud.ems.pojo.EmsEnergyScheduleVO;
import com.econ.powercloud.ems.pojo.requestVO.EmsEnergyScheduleRequestVO;

import java.util.List;

/**
 * @author zjr
 * @create 2021/7/22 下午2:23
 * @description
 */
public class EmsEnergyScheduleDO {
    /**
     * 集合：实体类->VO类
     * @param emsEnergySchedules
     * @return
     */
    public static List<EmsEnergyScheduleVO> entityListToVOList(List<EmsEnergySchedule> emsEnergySchedules){
        List<EmsEnergyScheduleVO> emsEnergyScheduleVOS = JacksonUtil.convertToList(emsEnergySchedules, EmsEnergyScheduleVO.class);
        return emsEnergyScheduleVOS;
    }

    /**
     * 实体类->VO类
     * @param energySchedule
     * @return
     */
    public static EmsEnergyScheduleVO entityToVO(EmsEnergySchedule energySchedule) {
        return JacksonUtil.convertToObj(energySchedule, EmsEnergyScheduleVO.class);
    }

    /**
     * requestVO类->实体类
     * @param emsEnergyScheduleRequestVO
     * @return
     */
    public static EmsEnergySchedule requestVOToEntity(EmsEnergyScheduleRequestVO emsEnergyScheduleRequestVO){
        return JacksonUtil.convertToObj(emsEnergyScheduleRequestVO, EmsEnergySchedule.class);
    }
}
